package com.ztools.pc.service.card;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ztools.common.model.pc.card.CardMaster;
import com.ztools.common.util.common.PageUtil;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author seeTools
 * @since 2023-06-26
 */
public interface CardMasterService extends IService<CardMaster> {

    /**
     * 分页查询
     *
     * @param pageUtil 分页数据
     * @return 对象
     */
    Page<CardMaster> findList(PageUtil<CardMaster> pageUtil);


    /**
     * 根据对象查询
     *
     * @param cardMaster cardMaster
     * @return CardMaster
     */
    List<CardMaster> findByObject(CardMaster cardMaster);


    /**
     * 修改
     *
     * @param cardMaster cardMaster
     * @return boolean
     */
    boolean update(CardMaster cardMaster);

    /**
     * 删除
     *
     * @param cardMaster cardMaster
     * @return boolean
     */
    boolean delete(CardMaster cardMaster);

    /**
     * 导出
     *
     * @param response   response
     * @param cardMaster cardMaster
     */
    void exportExcel(HttpServletResponse response, CardMaster cardMaster);


    /**
     * 根据会员ID获取可用储值卡列表
     *
     * @param memberId memberId
     * @return CardMaster
     */
    List<CardMaster> getCardList(Long memberId);

    /**
     * 获取卡信息
     *
     * @param cardNo cardNo
     * @return CardMaster
     */
    CardMaster getCardInfoByNo(String cardNo);

    /**
     * 开卡
     *
     * @param memberId memberId
     * @return boolean
     */
    boolean openCard(Long memberId);

    /**
     * 获取卡编号
     *
     * @return String
     */
    String getCardNo();
}
